﻿using Pivotbrowser.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace Pivotbrowser.Views
{
    public partial class RawView : UserControl
    {
        public RawView(MinimalStudent ms)
        {
            InitializeComponent();
            StringBuilder builder = new StringBuilder();
            builder.AppendLine("MATRNR\t\t\t\t\t\t\t" + ms.MATRNR);
            builder.AppendLine("NACHNAME\t\t\t\t\t\t" + ms.NACHNAME);
            builder.AppendLine("VORNAME\t\t\t\t\t\t" + ms.VORNAME);
            builder.AppendLine("GESCHLECHT\t\t\t\t\t" + ms.SEX);
            builder.AppendLine("GEBDATUM\t\t\t\t\t\t" + ms.GEBDATUM);
            builder.AppendLine("STRAßE\t\t\t\t\t\t\t\t" + ms.STRASSE);
            builder.AppendLine("PLZ\t\t\t\t\t\t\t\t\t\t" + ms.PLZ);
            builder.AppendLine("ORT\t\t\t\t\t\t\t\t\t" + ms.ORT);
            builder.AppendLine("");
            builder.AppendLine("MAIL1\t\t\t\t\t\t\t\t" + ms.MAIL);
            builder.AppendLine("MAIL2\t\t\t\t\t\t\t\t" + ms.MAIL2);
            builder.AppendLine("");
            builder.AppendLine("RÜCKGEMELDET\t\t\t" + ms.AKTIV);
            builder.AppendLine("STUDFACH\t\t\t\t\t\t" + ms.STUDFACH);
            builder.AppendLine("ECTS GESAMT\t\t\t\t" + ms.ECTSGESAMT);
            builder.AppendLine("DURCHSCHNITT\t\t\t" + ms.NOTENDURCHSCHNITT);
            builder.AppendLine("FACHSEMESTER\t\t\t" + ms.FACHSEMESTER);
            builder.AppendLine("HOCHSCHULSEM\t\t\t" + ms.HOCHSCHULSEMESTER);
            builder.AppendLine("");
            builder.AppendLine("AKTUELLE PRÜFUNGEN");
            foreach (PrüfungStudent ps in ms.p_collection_all)
            {
                builder.AppendLine(ps.SEMESTERBEZ + "\t\t" + ps.ZEUGNISBEZ + " (" + ps.TITEL + ")" + "\t\t" + ps.STUDFACH + "\t\t" + ps.ECTS + "CP" + "\t\t" + "Note:" + ps.NOTE_);
            }

            builder.AppendLine("");
            builder.AppendLine("ALTE PRÜFUNGEN");
            foreach (PrüfungStudent ps in ms.AltePrüfungen)
            {
                builder.AppendLine(ps.SEMESTERBEZ + "\t\t" + ps.ZEUGNISBEZ + " (" + ps.TITEL + ")" + "\t\t" + ps.FACHSEM + "/" + ps.STUDFACH + "\t\t" + ps.ECTS + "CP" + "\t\t" + "Note:" + ps.NOTE_);
            }

            builder.AppendLine("");
            builder.AppendLine("NOTIZEN");
            builder.AppendLine(ms.NOTIZ);

            this.tbRawContent.Text = builder.ToString();
        }
    }
}
